<!--
 * @Author: krsea 965837746@qq.com
 * @Date: 2025-03-03 09:03:00
 * @LastEditors: krsea 965837746@qq.com
 * @LastEditTime: 2025-03-03 09:43:29
 * @FilePath: \vue3-code\2305\week3\基础模板.html
 * @Description: 
 * 
 * Copyright (c) 2025 by ${git_name_email}, All Rights Reserved. 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>组件的基本使用</title>
    <!-- 引入 vue.js -->
    <script src="../js/vue.js"></script>
</head>

<body>
    <!-- div id 为 app 挂载点 -->
    <div id="app">
        <my-component-name></my-component-name>
        <my-component-name></my-component-name>  
        <!-- // 组件复用 -->
    </div>

    <!-- 使用 javascript 脚本 -->
    <script type="text/javascript">
        Vue.component('my-component-name', {
            // ... 选项 ...
            data: function () {
                return {
                    message: 'hello'
                }
            },
            template: '<div>{{ message }}</div>'
        })
        var app = new Vue({
            // 挂载点
            el: '#app',
        })


    </script>
</body>

</html>